/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FRC2856.Robot;

import java.util.Vector;

/**
 *
 * @author Henry
 */
public class Utils 
{
    public static String[] split(String original, String separator) 
	{
		Vector nodes = new Vector();
		int index = original.indexOf(separator);
		while(index >= 0) 
		{
			nodes.addElement(original.substring(0, index));
			original = original.substring(index+separator.length());
			index = original.indexOf(separator);
		}
		nodes.addElement(original);
		String[] result = new String[ nodes.size() ];
		if( nodes.size() > 0 ) 
		{
			for(int loop=0; loop < nodes.size(); loop++)
			{
				result[loop] = (String)nodes.elementAt(loop);
			}
		}
		return result;
	}
}
